package com.ltkj.baseplatform.feign;

import com.ltkj.baseplatform.domain.bo.LoginBodyBo;
import com.ltkj.common.core.domain.R;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.context.annotation.Import;

public class RemoteAuthFallbackFactory implements FallbackFactory<RemoteAuthService> {
    @Override
    public RemoteAuthService create(Throwable cause) {
        return  new RemoteAuthService(){
            @Override
            public R<?> loginForWx(LoginBodyBo loginBodyBo) {
                return R.fail("微信登录失败:" + cause.getMessage());
            }

            @Override
            public R<?> login(LoginBodyBo loginBodyBo) {
                return R.fail("登录失败:" + cause.getMessage());
            }

            @Override
            public R<?> logout(String source) {
                return R.fail("退出登录失败:" + cause.getMessage());
            }
        };
    }
}
